# Load d3blocks
from d3blocks import D3Blocks
#
# Initialize
d3 = D3Blocks(chart='Scatter')
#
# Import example
df = d3.import_example('cancer')
#
# Set properties
d3.set_edge_properties(df['x'].values,
                           df['y'].values,
                           x1=df['PC1'].values,
                           y1=df['PC2'].values,
                           label_radio=['tSNE','PCA'],
                           size=df['survival_months'].fillna(1).values / 10,
                           color=df.index.values,
                           tooltip=df['labels'].values + ' <br /> Survival: ' + df['survival_months'].astype(str).str[0:4].values,
                           scale=True)
#
# Show the chart
d3.show()
#
# Set specific node properties.
print(d3.edge_properties)
d3.edge_properties.loc[0,'size']=50
d3.edge_properties.loc[0,'color']='#000000'
d3.edge_properties.loc[0,'tooltip']='I am adjusted!'
#
# Configuration can be changed too.
print(d3.config)
#
# Show the chart again with adjustments
d3.show()